#include <bits/stdc++.h>
using namespace std;

const int months[13][2] = {{0,0},{31,31},{28,29},{31,31},{30,30},{31,31}
	,{30,30},{31,31},{31,31},{30,30},{31,31}
	,{30,30},{31,31}
};

bool isLeap(int year) {
	return (!(year%400) || ((year%100)&&!(year%4)));
}

int main () {
	int time1,y1,m1,d1;
	int time2,y2,m2,d2;

	while(scanf("%d\n%d",&time1,&time2) != EOF) {
		if(time2<time1) {
			swap(time1,time2);
		}
		y1 = time1/10000;
		y2 = time2/10000;
		m1 = (time1-10000*y1)/100;
		m2 = (time2-10000*y2)/100;
		d1 = time1%100;
		d2 = time2%100;
//		printf("y1 = %d\n",y1);
//		printf("m1 = %d\n",m1);
//		printf("d1 = %d\n",d1);
//		printf("y2 = %d\n",y2);
//		printf("m2 = %d\n",m2);
//		printf("d2 = %d\n",d2);

		int result = 0;
		while(y1<y2 || m1<m2 || d1<d2) {
			d1++;
			if(d1 == (months[m1][isLeap(y1)]+1)) {
				d1 = 1;
				m1++;
			}
			if(m1==13){
				m1 = 1;
				y1++;
			}
			
			result ++;

		}
		if(time1!=time2) {
			result++;
		}

		printf("%d\n",result);

	}

	return 0;
}
